package common.html;

import java.io.FileInputStream;
import common.Cache;
import common.CacheManager;

public class StaticPageTemplateManager
{

    static class PageKey
    {

    }

    public void register(String method, String path, String resPath)
    {
        try
        {
            CacheManager.putCache("login", new Cache("login", readTemplate(path)));
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }

    private String readTemplate(String path) throws Exception
    {
        FileInputStream in = new FileInputStream(path);
        int size = in.available();
        byte[] buffer = new byte[size];
        in.read(buffer);
        in.close();
        return new String(buffer, "utf-8");
    }

    public static void add()
    {

    }
}
